<template>
  <div>
    <el-container>
      <el-header>
        <el-card style="position: relative">
          <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/">订单</a></el-breadcrumb-item>
            <el-breadcrumb-item>退换原因设置</el-breadcrumb-item>
          </el-breadcrumb>
          <div style="position: absolute;right: 20px;top: 8px">
            <el-dropdown trigger="click">
  <span class="el-dropdown-link" style="cursor: pointer;
            color: #409EFF;">
      <img src="http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg"
           style="width: 40px;height: 40px;border-radius: 10px;">
  <i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <a style="text-decoration: none" href="/">首页</a>
                </el-dropdown-item>
                <el-dropdown-item>
                  <a style="text-decoration: none" href="/">退出</a>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </el-card>
      </el-header>
      <el-main>
        <el-card style="position: relative;margin-top: 5px">
          <span>
            <i class="el-icon-notebook-2"></i>数据列表
          </span>
          <el-button @click="dialogFormVisible = true" style="position: relative;margin-left: 1000px;">添加</el-button>
          <el-dialog title="退换货地址" :visible.sync="dialogFormVisible">
            <el-form :model="form">
              <el-form-item label="原因类型" :label-width="formLabelWidth">
                <el-input v-model="form.name" autocomplete="off" style="width: 300px"></el-input>
              </el-form-item>
              <el-form-item label="排序" :label-width="formLabelWidth">
                <el-input v-model="form.aaa" autocomplete="off" style="width: 300px"></el-input>
              </el-form-item>
              <el-form-item label="是否可用" :label-width="formLabelWidth">
                <el-switch v-model="value" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="dialogFormVisible = false">取 消</el-button>
              <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
            </div>
          </el-dialog>
        </el-card>
        <template>
          <el-table :data="tableData" border style="width: 100%;margin-top: 20px">
            <el-table-column type="selection" width="80" align="center"></el-table-column>
            <el-table-column prop="date" label="编号" width="140" align="center"></el-table-column>
            <el-table-column prop="name" label="原因类型" width="200" align="center"></el-table-column>
            <el-table-column prop="name" label="排序" width="80" align="center"></el-table-column>
            <el-table-column prop="name" label="是否可用" width="200" align="center">
              <el-switch v-model="value" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
            </el-table-column>
            <el-table-column prop="name" label="添加时间" width="160" align="center"></el-table-column>
            <el-table-column prop="address" label="操作" align="center">
              <el-button>编辑</el-button>
              <el-button>删除</el-button>
            </el-table-column>
          </el-table>
        </template>
      </el-main>
      <el-footer style="position: relative;top: 10px">
        <div style="position: relative;left: 0;top: 0;margin-top: 10px">
          <div style="position: absolute;right: 150px">
              <span style="font-size: 15px">共5条
            <template>
              <el-select v-model="val" filterable placeholder="10条/页" style="text-align: center; text-align-last: center; margin-right: 20px">
                <el-option
                    v-for="item in options"
                    :key="item.val"
                    :label="item.label"
                    :value="item.val">
                </el-option>
              </el-select>
            </template>
          <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" style="width: 130px;height: 20px;">
          </el-input-number></span>
          </div>
          <div style="position: absolute;right: 0">
                  <span>前往第:
                    <el-input style="width: 50px;height: 20px"
                              placeholder="1" v-model="input">
                    </el-input>
                  <span style="font-size:15px">页</span></span>
          </div>
        </div>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogFormVisible: false,
      form: {
        name: '',
        aaa:0,
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '120px',
      value: true,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市'
      },{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市'
      },{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市'
      },{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市'
      }
      ],
      ruleForm:{
        date1:'',
        date2:'',
      },
      rules:{
        date1: [
          { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
        ],
        date2:[
          { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
        ],
      },
      formInline: {
        user: '',
        region: ''
      }
    }
  },
  methods: {
    onSubmit() {
      console.log('submit!');
    }
  }
}
</script>

<style scoped>

</style>